package com.master.train.batch.job;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.master.train.batch.feign.BusinessFeign;
import jakarta.annotation.Resource;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


import java.util.Date;

public class DailyTrainJob implements Job {

    @Resource
    BusinessFeign businessFeign;

    private static final Logger LOG = LoggerFactory.getLogger(DailyTrainJob.class);
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
//        生成15天之后的车次相关信息
        LOG.info("执行生成15天之后的车次相关信息");
        Date date = new Date();
        DateTime dateTime = DateUtil.offsetDay(date, 15);
        Date jdkDate = dateTime.toJdkDate();
        businessFeign.genDaily(jdkDate);

    }
}
